package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * LocalSaleGoods entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_LOCAL_SALE_GOODS", schema = "MXZ")
public class LocalSaleGoods extends Entity implements java.io.Serializable {

	// Fields

	private Long saleGoodsId;
	private StoreGoods storeGoods;
	private LocalSale localSale;
	private Integer type;
	private Float amount;
	private Float cost;

	// Constructors

	/** default constructor */
	public LocalSaleGoods() {
	}

	/** full constructor */
	public LocalSaleGoods(StoreGoods storeGoods, LocalSale localSale,
			Integer type, Float amount, Float cost) {
		this.storeGoods = storeGoods;
		this.localSale = localSale;
		this.type = type;
		this.amount = amount;
		this.cost = cost;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_LOCAL_SALE_GOODS")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "SALE_GOODS_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getSaleGoodsId() {
		return this.saleGoodsId;
	}

	public void setSaleGoodsId(Long saleGoodsId) {
		this.saleGoodsId = saleGoodsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_GOODS_ID", nullable = false)
	public StoreGoods getStoreGoods() {
		return this.storeGoods;
	}

	public void setStoreGoods(StoreGoods storeGoods) {
		this.storeGoods = storeGoods;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SALE_ID", nullable = false)
	public LocalSale getLocalSale() {
		return this.localSale;
	}

	public void setLocalSale(LocalSale localSale) {
		this.localSale = localSale;
	}

	@Column(name = "TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "AMOUNT", nullable = false, precision = 8)
	public Float getAmount() {
		return this.amount;
	}

	public void setAmount(Float amount) {
		this.amount = amount;
	}

	@Column(name = "COST", nullable = false, precision = 8)
	public Float getCost() {
		return this.cost;
	}

	public void setCost(Float cost) {
		this.cost = cost;
	}

}